package com.baizhi.controller;

import com.baizhi.entity.Country;
import com.baizhi.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("country")
public class CountryController {
    @Autowired
    private CountryService countryService;

    @RequestMapping("selectAll")
    public Map selectAll(){
        Map map = new HashMap();
        List<Country> countries = countryService.selectAll();
        map.put("list",countries);
        return map;
    }
}
